<template>
  <div class="body">
    <router-view/>
  </div>
</template>

<script setup>
import {getCurrentInstance, onMounted} from 'vue'

const {proxy} = getCurrentInstance()

const initWs = () => {
  proxy.WebSocket.initWs();
};

onMounted(() => {
  if(localStorage.getItem("token")) {
    initWs();
  }
});
</script>

<style lang="scss" scoped>
.body {
  width: 100%;
  height: 100vh;
  overflow-y: hidden;
  background-color: #555;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
